<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

$this->title = Yii::t('app', 'car Brands');
$this->params['breadcrumbs'][] = $this->title;
?>
<h1><?= Html::encode($title) ?></h1>

<?php $form = ActiveForm::begin(['id' => 'search_form', 'method' => 'get', 'options' => ['style' => 'margin-top:5px;']]); ?>
车名：<input type="text" value="<?php echo Yii::$app->getRequest()->get('name', ''); ?>" name="name" class="txt"
          style="width:180px;height: 32px">&nbsp;
<input type="submit" name="search_submit" value="过滤" class="btn btn-info">
<?php ActiveForm::end(); ?>
<br>
<form name="listform" method="post">
    <table class="tb tb2 fixpadding">
        <?php foreach ($data as $value): ?>
            <span style="width:20%;display:inline-block;">
                <p>
                    <figure class="effect-steve">
                    <?php if (!empty($value->image)): ?>
                            <a href="<?php echo Url::to(['car-info', 'id' => $value->id, 'brand_id' => $brand_id, 'title' => $title .'-'. $value->title]); ?>">
                                <img src="<?php echo $value->image; ?>" style="width:85%;">
                            </a>
                    <?php else: ?>
                        <a href="<?php echo Url::to(['car-info', 'id' => $value->id, 'brand_id' => $brand_id, 'title' => $title .'-'. $value->title]); ?>">
                            <img src="<?php echo $img_url; ?>" style="width:85%;">
                        </a>
                    <?php endif; ?>
				    </figure>
                </p>
                <nav class="cl-effect-1">
                    <p align="center">
                        <a href="<?php echo Url::to(['car-info', 'id' => $value->id, 'brand_id' => $brand_id, 'title' => $title .'-'. $value->title]); ?>" >
                            <?php echo $value->title ?>
                        </a>
                    </p>
                </nav>
            </span>
        <?php endforeach; ?>
    </table>
    <?php if (empty($data)): ?>
        <div class="no-result">暂无记录</div>
    <?php endif; ?>
</form>
